package com.qersoft.controller;

import com.qersoft.entity.toBankMSG;
import com.qersoft.service.WQInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("wqOptions")
public class WQBankControllor {

    @Autowired
    private WQInfoService wqInfoService;


    @PostMapping("/add")
    public toBankMSG addWQ(@RequestParam Long userId,
                           @RequestParam Long questionId)
    {
        return toBankMSG.message(wqInfoService.add(userId,questionId));
    }

    @DeleteMapping("/del")
    public toBankMSG delMQ(@RequestParam Long userId,
                           @RequestParam Long questionId)
    {
        return toBankMSG.message(wqInfoService.del(userId,questionId));
    }
}
